package com.md.lession8;

import java.util.Scanner;

/*
 * /用户输入整数n，计算1!+(1!+2!)+(1!+2!+3!)+…..+(1!+2!+…n!)
 */
public class Demo3 {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("输入一个整数：");
		int a = scanner.nextInt();
		int jc = 1;
		for (int x = 2; x <= a; x++) {
			jc*=x;
		}
		System.out.println(a+"的阶乘是："+jc);
	}
}

